home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_15_aet_forgive.cog < prev    next >
Text File  |  1999-11-15  |  15KB  |  573 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 15_AET_Forgive.cog
  4. #
  5. # Indy forgives Sophia's treachery
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. # .................................. MESSAGES ..................................
  16.  
  17.     message        startup
  18.     message        pulse
  19.     message        user0
  20.     #### message        entered #### TEST ONLY #### REMOVE BEFORE FLIGHT
  21.     
  22. # .................................. KEYFRAMES .................................
  23.     
  24.     keyframe    in_armsCrossed=0in_stand2.key            local
  25.     keyframe    in_handsONhips=0in_stand4.key            local
  26.     keyframe    in_crossArms=0in_stand1_bd_2.key           local # 48x
  27.     keyframe    in_handsTOhips=0in_stand1_bd_4.key           local # 26x
  28.     keyframe    in_ltarmup=0in_leftarm_1_1.key            local
  29.     keyframe    in_hatpush=0in_figithat_4_4.key            local # 84x
  30.     keyframe    in_helpsophia=0in_helpsophia_1_1.key    local # 89x
  31.     keyframe    in_walkover=0in_embrace_1_16.key        local # 66x
  32.     keyframe    in_embrace=0in_stand16.key                local
  33.     keyframe    in_startled=0in_startled_16.key            local
  34.  
  35.     keyframe    so_checkhead=0so_twoheads_2_2.key        local # 87x
  36.     keyframe    so_hairbrush=0so_hair_2_4.key            local
  37.  
  38.     keyframe    so_armsATside=0so_stand2.key            local
  39.     keyframe    so_sideTOhips=0so_stand2_bd_1.key        local
  40.     keyframe    so_handsONhips=0so_stand1.key            local
  41.     keyframe    so_armsFolded=0so_stand4.key            local
  42.     
  43.     keyframe    so_lying=0so_stand8.key                    local
  44.     keyframe    so_standup=0so_getsup_8_2.key            local # 87x
  45.     keyframe    so_walkover=0so_embrace_1_9.key            local # 62x
  46.     keyframe    so_embrace=0so_stand9.key                local
  47.     keyframe    so_startled=0so_startled_9.key            local # 60x    
  48.  
  49. # .................................. MODELS ....................................
  50.  
  51.                 
  52. # .................................. SOUNDS ....................................
  53.  
  54.     sound        so_twoheads=At05s01.wav                    local
  55.     sound        in_twofaces=At05j02.wav                    local
  56.     sound        so_pardonme=At05s03.wav                    local
  57.     sound        in_turnerside=At05j04.wav                local
  58.     sound        so_neverlied=At05s05.wav                local
  59.     sound        in_humanenuf=At05j06.wav                local
  60.     sound        so_bastard=At05s07.wav                    local
  61.     sound        in_livetell=At05j08.wav                    local
  62.     sound        mus_forgive=mus_aet_forgivehug.wav        local
  63.  
  64. # ............................... ACTOR THINGS .................................
  65.  
  66.     thing        player                                    local
  67.     thing        indy                                    linkid=0
  68.     thing        sophia
  69.  
  70. # .............................. OBJECT THINGS .................................
  71.  
  72.  
  73.  
  74. # .............................. CAMERA THINGS .................................
  75.  
  76.     thing        cam_1                                    nolink
  77.     thing        cam_2                                    nolink
  78.     thing        cam_3                                    nolink
  79.     thing        cam_4                                    nolink
  80.     thing        cam_5                                    nolink
  81.     thing        cam_6                                    nolink
  82.     thing        cam_7                                    nolink
  83.     thing        cam_8                                    nolink
  84.  
  85.     thing        ct_1                                    nolink
  86.     thing        ct_2                                    nolink
  87.     thing        ct_3                                     nolink
  88.     thing        ct_4                                    nolink
  89.     thing        ct_5                                    nolink
  90.     thing        ct_6                                    nolink
  91.     thing        ct_7                                    nolink
  92.  
  93. # .............................. TARGET THINGS .................................
  94.  
  95.     thing        in_mk_1                                    nolink
  96.     thing        in_mk_2                                    nolink
  97. #    thing        in_mk_3                                    nolink
  98.     thing        in_mk_4                                    nolink
  99.  
  100.     thing        so_mk_1                                    nolink
  101.     thing        so_mk_2                                    nolink
  102.     thing        so_mk_3                                    nolink
  103.  
  104.     thing        kiss_mk_1                                nolink
  105.     thing        kiss_mk_2                                nolink
  106.     thing        spritedummy6                            nolink
  107.     thing        spritething                                local
  108.  
  109. # ........................... WORLD & ENGINE REFS ..............................
  110.  
  111.     template    tpl_sprite=aet_flash                    local    
  112.  
  113. # ............................... VARIABLES ....................................
  114.     
  115.     vector        v_targetpos                                local
  116.  
  117.     vector        posOffset                                local
  118.     vector        angOffset                                local
  119.     
  120.     flex        in_headrate                                local
  121.     flex        in_rotrate                                local
  122.     flex        so_rotrate                                local
  123.  
  124.     int            cutSceneState=0                            local # overall state var
  125.  
  126.     int            in_colltype                                local    
  127.     int            so_colltype                                local
  128.     
  129.     int            in_keytrack1                            local
  130.     int            in_keytrack2                            local
  131.     int            so_keytrack1                            local
  132.  
  133.     int            cursound                                local
  134.     int            musicchannel                            local
  135.     int            curcam                                    local
  136.     int            vibe                                    local
  137.     int            shake                                    local
  138.  
  139.     #### TEST ONLY #### REMOVE BEFORE FLIGHT
  140.  
  141.     thing        stage_1
  142.     thing        stage_2
  143.     thing        stage_3
  144.  
  145.     ####
  146.     
  147. # ......................... Tim Longo's added code .............................
  148.  
  149.     cog            timCog
  150.  
  151. end
  152.  
  153. # ==============================================================================
  154.  
  155. code
  156.  
  157. # ..............................................................................
  158.  
  159. startup:
  160.  
  161.     # Pointer to Player...
  162.     player = GetLocalPlayerThing();
  163.  
  164.     # Prep actors...
  165.     curcam = GetCurrentCamera();
  166.     so_rotrate = GetThingMaxRotVel(sophia);
  167.     SetThingFlags(indy, 0x80000);
  168.     SetThingFlags(sophia, 0x80000);
  169.     AISetCutSceneMode(indy);
  170.     AISetCutSceneMode(sophia);
  171.     in_headrate = GetThingMaxHeadVel(indy);
  172.     in_rotrate = GetThingMaxRotVel(indy);
  173.     in_colltype = GetCollideType(indy);
  174.     in_headrate = GetThingMaxHeadVel(indy);
  175.     in_rotrate = GetThingMaxRotVel(indy);
  176.     in_colltype = GetCollideType(indy);
  177.  
  178.     return;
  179.  
  180. # ..............................................................................
  181.  
  182.     # TO DO: blow up mini-Mophia, bring her to final resting place
  183.     # and thus conceal big move of player to stage...
  184.  
  185. # ..............................................................................
  186.  
  187. #### entered:
  188.     
  189.     #### TEST ONLY #### REMOVE BEFORE FLIGHT
  190.  
  191.     if ((GetSenderRef() == stage_1) || (GetSenderRef() == stage_2) || (GetSenderRef() == stage_3))
  192.     {
  193.         ClearThingFlags(stage_1, 0x80000);
  194.         ClearThingFlags(stage_2, 0x80000);
  195.         ClearThingFlags(stage_3, 0x80000);
  196.         goto user0;
  197.     }
  198.  
  199.     return;
  200.  
  201. # ..............................................................................
  202.  
  203. user0:
  204.  
  205.     # NOTE: received from aet_RotateCage.cog when Mophia is no more...
  206.  
  207.     if (cutSceneState != 0)
  208.     {
  209.         return;
  210.     }
  211.  
  212.     # Prep...
  213.     cutSceneState = 1;
  214.     //curcam = GetCurrentCamera();
  215.     ResetCameraFOV(0, 0.0);
  216.     SetCameraLookInterp(2, 0);
  217.     SetCameraPosInterp(2, 0);
  218.             
  219.     //StartCutScene(2);
  220.  
  221.     SetActorFlags(player, 0x200000);
  222.     //DeselectWeapon(player);
  223.     ResetThing(player);
  224.     PlayMode(player, 1, 0);
  225.     CopyPlayerHolsters(player, indy);
  226.     SetThingflags(player, 0x80000);
  227.     
  228.     # Sophia is back to normal, crumpled on the floor...
  229.     ClearThingFlags(sophia, 0x80000);
  230.     TeleportThing(sophia, so_mk_1);
  231.     so_keytrack1 = PlayKey(sophia, so_lying, 2, 0x10, 0);
  232.     
  233.     # Cut to Sophia...
  234.     SetCameraFocus(2, cam_1);
  235.     SetCameraSecondaryFocus(2, ct_1);
  236.     SetCurrentCamera(2);
  237.     SetCameraFOV(50, 0, 0.0);
  238.  
  239.     # Place Indy...
  240.     ClearThingFlags(indy, 0x80000);
  241.     TeleportThing(indy, in_mk_1);
  242.     AISetLookThing(indy, sophia);
  243.  
  244.     # VFX here...
  245.     spritething = CreateThing(tpl_sprite, spritedummy6);
  246.     CaptureThing(spritething);
  247.     AnimateSpriteSize(spritething, '3 3 1', '4 4 1', 0.2);
  248.     Sleep(0.2);
  249.     AnimateSpriteSize(spritething, '4 4 1', '5 5 0', 0.5);
  250.     Sleep(0.5);
  251.  
  252.     # Get ready to dolly...
  253.     SetCameraInterpSpeed(2, 3.0);
  254.     SetCameraLookInterp(2, 1);
  255.     SetCameraPosInterp(2, 1);
  256.     Sleep(0.01);
  257.  
  258.     # Play music...
  259.     musicchannel = PlaySoundLocal(mus_forgive, 1.0, 0.0, 0x0, 0);
  260.     
  261.     # Indy helps Sophia to her feet...
  262.     PlayKey(indy, in_helpsophia, 4, 0x12, 0);
  263.     StopKey(sophia, so_keytrack1, 0.0);
  264.     so_keytrack1 = PlayKey(sophia, so_armsATside, 2, 0x10, 0);
  265.     PlayKey(sophia,  so_standup, 4, 0x12, 0);
  266.  
  267.     # Pull back to watch...
  268.     SetCameraFocus(2, cam_2);
  269.     SetCameraSecondaryFocus(2, ct_2);
  270.     SetCameraFOV(58, 1, 3.0);
  271.     Sleep(3.5);
  272.  
  273.     # Cut to Indy and push in...
  274.     SetCameraLookInterp(2, 0);
  275.     SetCameraPosInterp(2, 0);
  276.     SetCameraFocus(2, cam_3);
  277.     SetCameraSecondaryFocus(2, ct_3);
  278.     SetCameraFOV(40, 0, 0.0); # was 43
  279.     Sleep(0.01);
  280.     SetCameraFOV(30, 1, 3.0); # was 33
  281.     in_keytrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  282.     PlayKey(indy, in_crossArms, 4, 0x12, 1); # 1.6 sec
  283.     Sleep(1.5);
  284.     
  285.     # Cut to Sophia and push in...
  286.     SetCameraFocus(2, cam_4);
  287.     SetCameraSecondaryFocus(2, ct_4);
  288.     SetCameraFOV(38, 0, 0.0);
  289.     SetThingFlags(indy, 0x10); # invis
  290.     Sleep(0.01);
  291.     SetCameraFOV(28, 1, 3.0);
  292.     
  293.     # Sophia: "What...have I got two heads or something?"
  294.     cursound = PlayVoice(sophia, so_twoheads, 1.0, 0); # 2.96s
  295.     PlayKey(sophia, so_checkhead, 4, 0x12, 0);
  296.     WaitForSound(cursound);
  297.  
  298.     # Cut back to Indy...
  299.     SetCameraFocus(2, cam_3);
  300.     SetCameraSecondaryFocus(2, ct_3);
  301.     SetCameraFOV(33, 0, 0.0);
  302.     ClearThingFlags(indy, 0x10); # vis
  303.     Sleep(0.01);
  304.     SetCameraFOV(28, 1, 2.0);
  305.  
  306.     # Indy: "No, two faces maybe."
  307.     cursound = PlayVoice(indy, in_twofaces, 1.0, 0); # 1.97 sec
  308.     WaitForSound(cursound);
  309.     Sleep(0.1);
  310.  
  311.     # Cut to wider shot of both...
  312.     SetCameraFocus(2, cam_5);
  313.     SetCameraSecondaryFocus(2, ct_5);
  314.     SetCameraFOV(52, 0, 0.0);
  315.  
  316.     # Sophia: "Pardon me?!"
  317.     cursound = PlayVoice(sophia, so_pardonme, 1.0, 0);
  318.     StopKey(sophia, so_keytrack1, 0.0);
  319.     so_keytrack1 = PlayKey(sophia, so_handsONhips, 2, 0x10, 0);
  320.     PlayKey(sophia, so_sideTOhips, 4, 0x12, 1);
  321.     WaitForSound(cursound);
  322.  
  323.     # Indy: "You were on Turner's side...until the end."
  324.     cursound = PlayVoice(indy, in_turnerside, 1.0, 0);
  325.     StopKey(indy, in_keytrack1, 0.5);
  326.     Sleep(0.5);
  327.     PlayKey(indy, in_ltarmup, 4, 0x12, 0);
  328.     WaitForSound(cursound);
  329.  
  330.     # Sophia: "I never lied...doing my job."
  331.     StopKey(sophia, so_keytrack1, 0.5);
  332.     Sleep(0.2);
  333.     cursound = PlayVoice(sophia, so_neverlied, 1.0, 0);
  334.     Sleep(0.3);
  335.     so_keytrack1 = PlayKey(sophia, so_armsFolded, 2, 0x10, 0);
  336.     PlayKey(sophia, so_hairbrush, 4, 0x12, 1);
  337.     WaitForSound(cursound);
  338.     in_keytrack2 = PlayKey(indy, in_handsONhips, 2, 0x10, 0);
  339.     PlayKey(indy, in_handsTOhips, 4, 0x12, 1);
  340.  
  341.     # Cut close on Indy...
  342.     SetCameraFocus(2, cam_3);
  343.     SetCameraSecondaryFocus(2, ct_3);
  344.     SetCameraFOV(32, 0, 0.0);
  345.  
  346.     # Cheat actors to marks...
  347.     TeleportThing(indy, kiss_mk_2);
  348.     TeleportThing(sophia, kiss_mk_1);
  349.  
  350.     ChangeSoundVol(musicchannel, 0.3, 3.0);
  351.     
  352.     # Indy: "I guess that's human enough."
  353.     SetCameraInterpSpeed(2, 2.0);
  354.     SetCameraLookInterp(2, 1);
  355.     SetCameraPosInterp(2, 1);
  356.     Sleep(0.2);
  357.     PlayKey(indy, in_hatpush, 4, 0x12, 1);
  358.     cursound = PlayVoice(indy, in_humanenuf, 1.0, 0);
  359.     Sleep(1.5);
  360.     StopKey(indy, in_keytrack1, 0.5);
  361.     Sleep(0.5);
  362.     WaitForSound(cursound);
  363.     
  364.     # Pull back to see them embrace...
  365.     SetCameraFocus(2, cam_6);
  366.     SetCameraSecondaryFocus(2, ct_6);
  367.     SetCameraFOV(65, 1, 2.0);
  368.     
  369.     StopKey(sophia, so_keytrack1, 0.0);
  370.     PlayKey(sophia, so_walkover, 4, 0x12, 0);
  371.     PlayKey(indy, in_walkover, 4, 0x12, 1);
  372.     in_keytrack1 = PlayKey(indy, in_embrace, 2, 0x10, 0);
  373.     so_keytrack1 = PlayKey(sophia, so_embrace, 2, 0x10, 0);
  374.     ## Sleep(1.0);
  375.  
  376.     # Swing around the romantic pair...
  377.     SetCameraLookInterp(2, 0);
  378.     SetCameraPosInterp(2, 0);
  379.     AttachThingToThing(cam_6, ct_6);
  380.     Rotate(ct_6, -370, 1, 6.0);
  381.     SetCameraFOV(40, 1, 4.2);
  382.  
  383.     # Sophia: "You bastard."
  384.     PlayVoice(sophia, so_bastard, 1.0, 0);    
  385.     Sleep(1.0);    
  386.     SetPulse(0.1);
  387.  
  388.     Sleep(1.0);    
  389.     SetPulse(0.0);
  390.     Sleep(1.0);
  391.     
  392.     ChangeSoundVol(musicchannel, 1.0, 1.0);
  393.  
  394.     # Camera shakes as world starts to disintegrate...
  395.     shake = 1;
  396.     SetPulse(0.1);
  397.     Sleep(1.0);
  398.     shake = 2;
  399.     SetCAmeraFOV(75, 1, 0.8);
  400.     Sleep(1.0);
  401.     shake = 3;
  402.  
  403.     # TO DO: visual effects of flashing and popping...
  404.  
  405.     # Indy: "Let's live to tell this tale!"
  406.     PlayVoice(indy, in_livetell, 1.0, 0);
  407.     StopKey(indy, in_keytrack1, 0.0);
  408.     StopKey(sophia, so_keytrack1, 0.0);
  409.     TeleportThing(indy, in_mk_2);
  410.     TeleportThing(sophia, so_mk_2);
  411.     PlayKey(indy, in_startled, 4, 0x12, 0);
  412.     SetThingMaxRotVel(sophia, 180.0);
  413.     AISetLookThing(sophia, so_mk_3);
  414.     PlayKey(sophia, so_startled, 4, 0x12, 1);
  415.     shake = 2;
  416.  
  417.     # Cut to long shot...
  418.     SetCameraFocus(2, cam_7);
  419.     SetCameraSecondaryFocus(2, ct_7);
  420.     SetCameraFOV(70, 0, 0.0);
  421.     SetCollideType(indy, in_colltype);
  422.     SetCollideType(sophia, so_colltype);
  423.             
  424.     # Sophia flees...
  425.     AISetMoveSpeed(sophia, 3.2);
  426.     AISetMoveThing(sophia, so_mk_3, 0);
  427.     AIEnableBodyTracking(indy, sophia); # Indy watches her go
  428.     Sleep(0.01);
  429.  
  430.     # Pull back to watch...
  431.     SetCameraFOV(50, 1, 2.0);
  432.     SetCameraInterpSpeed(2, 2.0);
  433.     SetCameraLookInterp(2, 1);
  434.     SetCameraPosInterp(2, 1);
  435.     Sleep(2.0);
  436.     AIDisableBodyTracking(indy);
  437.     AISetLookThing(indy, in_mk_4);
  438.     SetCameraFocus(2, cam_8);
  439.     SetCameraFOV(90, 1, 1.8);
  440.     Sleep(2.0);
  441.  
  442.     # Restore control...
  443.     shake = 1;
  444.     v_targetpos = GetThingPos(cam_8);
  445.     SetCameraPosition(1, v_targetpos); # prep
  446.     CopyOrientAndPos(indy, player);
  447.     DestroyThing(indy);
  448.     DestroyThing(sophia);
  449.     ClearThingFlags(player, 0x80000);
  450.     SetCameraLookInterp(2, 0);
  451.     SetCameraPosInterp(2, 0);
  452.     SetCurrentCamera(1);
  453.     ResetCameraFOV(0, 0.0);
  454.     ClearActorFlags(player, 0x200000);
  455.  
  456.     # Kill shake...
  457.     SetPulse(0.0);
  458.  
  459.     # Tim Longo's added code for calling the turning off of Aetherium sectors.
  460.     SendMessage(timCog, user0);
  461.  
  462.     EndCutScene();
  463.  
  464.     return;
  465.  
  466. # ..............................................................................
  467.  
  468. pulse:
  469.  
  470.     if (shake == 3)
  471.     {
  472.         vibe = RandBetween(1, 3);
  473.         if (vibe == 3)
  474.         {
  475.             # Skip this time...
  476.             return;
  477.         }
  478.     }
  479.  
  480.     vibe = RandBetween(1, 4);
  481.     if (vibe == 1)
  482.     {
  483.         if (shake == 1)
  484.         {
  485.             posOffset = '-0.008 0.00 -0.002'; #1 was .005x
  486.             angOffset = '0.00 -0.002 0.002';
  487.         }
  488.         if (shake == 2)
  489.         {
  490.             posOffset = '0.01 -0.01 0.005'; #2
  491.             angOffset = '0.005 0.00 -0.005';
  492.         }
  493.         if (shake == 3)
  494.         {
  495.             posOffset = '0.01 0.02 -0.02'; #3
  496.             angOffset = '-0.01 0.01 -0.01';
  497.         }
  498.     }
  499.     if (vibe == 2)
  500.     {
  501.         if (shake == 1)
  502.         {
  503.             posOffset = '0.008 -0.005 0.002'; #2 was .005x
  504.             angOffset = '0.002 0.00 -0.002';
  505.         }
  506.         if (shake == 2)
  507.         {
  508.             posOffset = '0.005 0.01 -0.01'; #3
  509.             angOffset = '-0.005 0.005 -0.00';
  510.         }
  511.         if (shake == 3)
  512.         {
  513.             posOffset = '-0.02 0.00 0.02'; #4 was .01x
  514.             angOffset = '0.00 0.00 0.01';
  515.         }
  516.     }
  517.     if (vibe == 3)
  518.     {
  519.         if (shake == 1)
  520.         {
  521.             posOffset = '0.005 0.005 -0.005'; #3 was .002x
  522.             angOffset = '-0.002 0.005 -0.005';
  523.         }
  524.         if (shake == 2)
  525.         {
  526.             posOffset = '-0.015 0.00 0.01'; #4 was .01x
  527.             angOffset = '0.00 0.00 0.01';
  528.         }
  529.         if (shake == 3)
  530.         {
  531.             posOffset = '-0.025 0.00 -0.01'; #1 was .02x
  532.             angOffset = '0.00 -0.01 0.01';
  533.         }
  534.     }
  535.     if (vibe == 4)
  536.     {
  537.         if (shake == 1)
  538.         {
  539.             posOffset = '-0.002 0.00 0.005'; #4
  540.             angOffset = '0.00 0.00 0.002';
  541.         }
  542.         if (shake == 2)
  543.         {
  544.             posOffset = '-0.01 0.00 -0.005'; #1
  545.             angOffset = '0.00 -0.005 0.005';
  546.         }
  547.         if (shake == 3)
  548.         {
  549.             posOffset = '0.02 -0.02 0.01'; #2
  550.             angOffset = '0.01 0.00 -0.01';
  551.         }
  552.     }
  553.  
  554.     vibe = RandBetween(1, 3);
  555.     if (vibe == 1)
  556.     {
  557.         SetPulse(0.05);
  558.     }
  559.     if (vibe == 2)
  560.     {
  561.         SetPulse(0.1);
  562.     }
  563.     if (vibe == 3)
  564.     {
  565.         SetPulse(0.15);
  566.     }
  567.  
  568.     SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  569.  
  570.     return;
  571.     
  572. end
  573.